package at.fhooe.tuxgestures.cam.data;

import java.io.File;

import at.fhooe.tuxgestures.cam.data.event.DataEvent;
import at.fhooe.tuxgestures.cam.data.event.IDataEventListener;


public interface ICameraDataProvider
{
	
	/**
	 * Adds a listener to the data provider.
	 * Listeners receive events once the data provider reads data.
	 * @param listener the listener to be added
	 */
	public void addListener(IDataEventListener listener);
	
	/**
	 * Remove a listener.
	 * @see #addListener(IDataEventListener)
	 * @param listener the listener to be removed
	 */
	public void removeListener(IDataEventListener listener);
	
	/**
	 * Read (test-)data from a file and converts it to float matrix.
	 * Will send {@link DataEvent} once reading was done.
	 * The {@link DataEvent} contains the float matrix.
	 * 
	 * Note that you have to subscribe as a listener to this class to
	 * receive the events.
	 * 
	 * @param tofFile the file to be read
	 */
	public void startReadFromFile(File tofFile);
	
	/**
	 * Reads data from real camera
	 * 
	 * Note: might need some parameters once this is implemented
	 * @return the float matrix that represents the current state sent by the camera
	 */
	public void startReadFromCamera();
	
	/**
	 * Stops the reading thread.
	 */
	public void stopReading();
	
}
